import QtQuick 2.0
import QtQuick.Controls 2.5
import QtQuick.Dialogs 1.3


Rectangle {
    id:com
    Rectangle {
        width: 200
        height: 250
        border.color: "black"
        Image {
            anchors.centerIn: parent
            source: "/add.png"
        }
        MouseArea {
            id:file_btn
            anchors.fill: parent
            enabled: true
            hoverEnabled: true
            onClicked: {
                fileDialog.visible = true
            }
        }
        FileDialog {
            id: fileDialog
            title: "Please choose a file"
            folder: shortcuts.desktop
            visible: false

            onAccepted: {
                console.log("You chose: " + fileDialog.fileUrl)
                PluginHandler.addNewPlugin(fileDialog.fileUrl)
            }
            onRejected: {
                console.log("Canceled")
            }
        }
    }
}
